package cn.chencq.springcloud.backend.modules.sys.controller;

import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cn.chencq.springcloud.backend.modules.sys.entity.SysUserEntity;

/**
 * 
 * @ClassName:  AbstractController   
 * @Description:  Controller公共组件
 * @author: chaoqun.chen 
 * @date: 2019年5月12日 下午7:16:01
 */
public abstract class AbstractController {
	protected Logger logger = LoggerFactory.getLogger(getClass());
	
	protected SysUserEntity getUser() {
		return (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
	}

	protected Long getUserId() {
		return getUser().getUserId();
	}
}
